from time import sleep

from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.common.by import By

caps = {
    'platformName': 'Android',
    'platformVersion': '5.1.1',
    'deviceName': 'NNN',
    'appPackage': 'com.android.settings',
    'appActivity': '.Settings'
}
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_capabilities=caps)
waln = driver.find_element(By.XPATH, '//*[@text = "WLAN"]')
TA = TouchAction(driver)
TA.long_press(x=100, y=500)
# TA.press(waln)
# TA.wait(5000)


TA.perform()
sleep(3)
driver.quit()
